﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ControlesPrincipal.aspx.cs" Inherits="AudiPyme.UI.ControlesPrincipal"
    EnableEventValidation="false" %>

<%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Panel ID="PanelAdministrador" runat="server">
        <ul class="list1" id="ListaOpciones" runat="server">
            <li><a href="EmpresaNivMadurezPrincipal.aspx">Nivel Madurez Principal</a></li>
        </ul>
    </asp:Panel>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <div id='basic-modal' style="text-align: right">
        <a href='#' class='basic'>
            <img src="/Images/Icono_ayuda.jpg" alt="Pinche para ver un video tutorial de la página"
                width="30 " height="30" border="0"></a>
    </div>
    <!-- modal content -->
    <div id="basic-modal-content">
        <iframe width="853" height="480" src="http://www.youtube.com/embed/gt9w2FMPcV4" frameborder="0"
            allowfullscreen></iframe>
    </div>
    <!-- preload the images -->
    <div style='display: none'>
        <img src='Images/x.png' alt='' />
    </div>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <script type="text/javascript">
        function expandDetailsInGrid(_this) {
            var id = _this.id;
            var imgelem = document.getElementById(_this.id);
            var currowid = id.replace("A_View", "TR_Summmary") //Coge el Id la fila seleccionada

            var rowdetelemid = currowid;
            var rowdetelem = document.getElementById(rowdetelemid);
            if (imgelem.alt == "plus") {
                imgelem.src = "/Images/minus.gif"
                imgelem.alt = "minus"
                rowdetelem.style.display = 'table-row';
            }
            else {
                imgelem.src = "/Images/plus.gif"
                imgelem.alt = "plus"
                rowdetelem.style.display = 'none';
            }

            return false;

        }
    </script>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <h2>
                Nivel Madurez Actual: Gestionar</h2>
            <asp:Panel ID="PanelOpcClasif" runat="server" Visible="False">
                <h4>
                    Distribución de Controles por
                    <asp:Label ID="LblOpcion" runat="server"></asp:Label>
                    &nbsp;<asp:Label ID="LblTipoActivo" runat="server"></asp:Label>
                </h4>
                <h5>
                    Criterio de Clasificación</h5>
                <p>
                    <asp:DropDownList ID="DdlControles" runat="server" AutoPostBack="True" Width="150px"
                        OnSelectedIndexChanged="DdlControles_SelectedIndexChanged">
                        <asp:ListItem Value="RespuestasControles">Respuestas Controles</asp:ListItem>
                        <asp:ListItem Value="ObjetivosControl">Objetivos de Control</asp:ListItem>
                    </asp:DropDownList>
            </asp:Panel>
            &nbsp;
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>
            <asp:Panel ID="PnlDominios" runat="server" Height="76px" Width="550px" Visible="False">
                <h5>
                    Seleccione el Dominio del Objetivo de Control a Mostrar</h5>
                <asp:Label ID="LblDominio" runat="server" Text="Dominio:"></asp:Label>
                <asp:DropDownList ID="DdlDominio" runat="server" Width="400px" OnSelectedIndexChanged="DdlDominio_SelectedIndexChanged"
                    AutoPostBack="True">
                </asp:DropDownList>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <table>
        <tr>
            <td align="left" valign="top">
                <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <asp:Panel ID="PanelChart" runat="server" Visible="False">
                            <asp:Chart ID="Chart1" runat="server" Height="320px" Palette="None" PaletteCustomColors="DeepSkyBlue; SteelBlue; DodgerBlue; Blue; 0, 192, 192; Teal"
                                Width="341px" OnClick="Chart1_Click">
                                <Series>
                                    <asp:Series ChartArea="ChartArea1" Name="Series1" PostBackValue="#VALX" CustomProperties="DrawingStyle=Cylinder" />
                                </Series>
                                <ChartAreas>
                                    <asp:ChartArea Area3DStyle-Enable3D="True" Area3DStyle-IsRightAngleAxes="False" Area3DStyle-LightStyle="Realistic"
                                        Name="ChartArea1" BackColor="Transparent" BackSecondaryColor="Transparent" ShadowColor="White">
                                        <AxisY Interval="5" LabelAutoFitMinFontSize="6" LineColor="Gainsboro">
                                            <MajorGrid LineColor="Gainsboro" />
                                        </AxisY>
                                        <AxisX Interval="1" LabelAutoFitMinFontSize="9" TextOrientation="Rotated90" LineColor="Gainsboro">
                                            <MajorGrid LineColor="Gainsboro" />
                                        </AxisX>
                                        <AxisX2 LineColor="Gainsboro">
                                            <MajorGrid LineColor="Gainsboro" />
                                        </AxisX2>
                                        <AxisY2 LineColor="Gainsboro">
                                            <MajorGrid LineColor="Gainsboro" />
                                        </AxisY2>
                                        <Area3DStyle Enable3D="True" LightStyle="Realistic" Inclination="20" PointGapDepth="0" />
                                    </asp:ChartArea>
                                </ChartAreas>
                                <BorderSkin BackColor="White" />
                            </asp:Chart>
                        </asp:Panel>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
            <td align="left" valign="top">
                <asp:UpdatePanel ID="UpdatePanel4" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <asp:Panel ID="PanelGV" runat="server">
                            <asp:GridView ID="GVControles" runat="server" AutoGenerateColumns="false" OnRowCancelingEdit="GVControles_RowCancelingEdit"
                                OnRowEditing="GVControles_RowEditing" OnRowUpdating="GVControles_RowUpdating"
                                AllowPaging="True" OnPageIndexChanging="GVControles_PageIndexChanging" CssClass="myDatagrid"
                                Width="399px">
                                <Columns>
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <asp:ImageButton ID="A_View" runat="server" AlternateText="plus" ImageUrl="~/Images/plus.gif"
                                                OnClientClick="expandDetailsInGrid(this);return false;" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="IdControl" HeaderText="Id" ReadOnly="true" />
                                    <asp:BoundField DataField="Nombre" HeaderText="Nombre" ReadOnly="true" />
                                    <asp:BoundField DataField="ObjetivoControl" HeaderText="ObjControl" ReadOnly="true" />
                                    <asp:TemplateField HeaderText="Valor">
                                        <EditItemTemplate>
                                            <asp:DropDownList ID="DdlValor" runat="server" Width="55px">
                                                <asp:ListItem Selected="True" Value="0">-------</asp:ListItem>
                                                <asp:ListItem Value="SI">SI</asp:ListItem>
                                                <asp:ListItem Value="NO">NO</asp:ListItem>
                                                <asp:ListItem Value="PARC">PARC</asp:ListItem>
                                                <asp:ListItem Value="N/A">N/A</asp:ListItem>
                                            </asp:DropDownList>
                                            <asp:RequiredFieldValidator ID="ValDdl" runat="server" ControlToValidate="DdlValor"
                                                ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="ValDdlValor"></asp:RequiredFieldValidator>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <%# Eval("Valor")%>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:CommandField ButtonType="Button" CausesValidation="False" ShowCancelButton="true"
                                        ShowEditButton="true" EditImageUrl="Images/button_ok.png" HeaderText="Editar"
                                        ItemStyle-HorizontalAlign="Center" />
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <tr id="TR_Summmary" runat="server" style="display: none">
                                                <td colspan="7">
                                                    <table>
                                                        <tr>
                                                            <td>
                                                            </td>
                                                            <td>
                                                                <asp:Label ID="Label1" runat="server" Text='<%#Eval("Descripcion")%>'></asp:Label>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                        </asp:Panel>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
    </table>
</asp:Content>
